home *** CD-ROM | disk | FTP | other *** search
- Path: wjk130.rh.psu.edu!koscho
- From: koscho@wjk130.rh.psu.edu (William Koscho)
- Newsgroups: comp.lang.c,comp.graphics.algorithms,rec.games.programmer
- Subject: Speed question here...
- Date: 14 Feb 1996 21:58:41 GMT
- Organization: Penn State University, Center for Academic Computing
- Message-ID: <4ftluh$1gkv@hearst.cac.psu.edu>
- NNTP-Posting-Host: wjk130.rh.psu.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- I was curious as to how fast something like the
- following would execute:
-
- int x;
- node *ptr; ptr in linked list
-
- for ( ptr = first_node; ptr != NULL; ptr = ptr.next ) {
- for ( x = 0; x < max; x++ ) {
- array[x] = array_other[x];
- }
- }
-
- I really am not interested in the assignment statement, that's easy.
- but the traversal through the linked list, and inner integer incremental
- for loop for each node visited. How fast is a traversal through
- a linked list when you do a for loop at each node?
-
- thanks
-
-
- --
-
- koscho@wjk130.rh.psu.edu
- koscho@crayola.cse.psu.edu
- koscho@cse.psu.edu
-
- http://www.cse.psu.edu/~koscho
-
-